<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    let user = {
        name : "chen",
        age : 18,
        gender : "男"
    };

    // 将对象转化为JSON字符串
    let s = JSON.stringify(user);
    // 将JSON字符串转化为对象
    let user2 = JSON.parse('{"name":"chen","age":18,"gender":"男"}');
</script>

</body>
</html>